﻿using Minesweeper.Test;

namespace Minesweeper.Logic
{
    public class Controller
    {
        public static string[] Start(string[] input)
        {
            if (input.Length == 0)
            {
                return input;
            }
            
            var BombFinder = new BombFinder();
            var Solver = new Solver();
            var StringConverter = new StringConverter();
            var XDimension = input[0].Length;
            var YDimension = input.Length;

            var Bombs = BombFinder.GetBombList(input);
            var SolvedPlan = Solver.Solve(Bombs, XDimension, YDimension);
            var SolutionArray = StringConverter.Convert(SolvedPlan,YDimension);

            return SolutionArray;
        }
    }
}